package demo1.server;

import org.apache.cxf.frontend.ServerFactoryBean;

public class MainServer {

    protected MainServer() throws Exception {

            HelloServiceImpl helloworldImpl = new HelloServiceImpl();

            ServerFactoryBean svrFactory = new ServerFactoryBean();

            svrFactory.setServiceClass(IHelloService.class);

            svrFactory.setAddress("http://127.0.0.1:9000/Hello");

            svrFactory.setServiceBean(helloworldImpl);

            //svrFactory.getServiceFactory().setDataBinding(new AegisDatabinding());

            svrFactory.create();

        }

        public static void main(String args[]) throws Exception {

            new MainServer();

            System.out.println("Server ready...");

            Thread.sleep(5 * 60 * 1000);

            System.out.println("Server exiting");

            System.exit(0);

        }

}